function genHTML(gifts){
	var html='';
	for( var i=0;i<gifts.length;i++){
	var giftrecord=gifts[i][0];
	var gift=gifts[i][1];
	html+='<div class="message-box"><h3><span class="right" style="margin-right: 20px;">' +
			'日期:'+giftrecord.date+'</span><a href="#" style="margin-left: 10px;">' +
			giftrecord.receiveUserNo+'</a></h3><table cellpadding="3" border="0" cellspacing="0" width="100%" class="message">' +
			'<tr><td class="message-face"><img src="upload/005.jpg" alt="" /></td><td valign="top" style="padding-top: 20px; padding-left: 20px;">' +'<img src='+gift.photo+'>'+giftrecord.message+'</td></tr></table>';
	}
	return html;
}


function genRecvHTML(gifts){
	var html='';
	for( var i=0;i<gifts.length;i++){
		
	var giftrecord=gifts[i][0];
	var gift=gifts[i][1];
	
	html+='<div class="message-box"><h3><span class="right" style="margin-right: 20px;">' +'日期:'+giftrecord.date+'</span><a href="#" style="margin-left: 10px;">' +giftrecord.senderUserNo+'</a></h3><table cellpadding="3" border="0" cellspacing="0" width="100%" class="message">'+'<tr><td class="message-face"><img src="upload/005.jpg" alt="" /></td><td valign="top" style="padding-top: 20px; padding-left: 20px;">' +'<img src='+gift.photo+'><pre>'+giftrecord.message+'</pre></td></tr></table>';
	}
	return html;
}


var $J = jQuery.noConflict();
function bindEvent(){
	$J("#receivedGift").click(listGift);
	$J("#sentGift").click(listsentGift);	
}

$J(bindEvent);
$J(function(){$J("#receivedGift").trigger('click')});